<%@page contentType="text/html;charset=UTF-8" language = "java"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<html>
	<head>
		<title>JWiki 用户登录</title>
    <script language = "javascript">
    	function checkform(){
    		if(form1.Username.value==""){
    			alert("用户名不能为空！");
    			form1.Username.focus();
    			return false;
    		}
    		if(form1.Username.value.length<1||form1.Username.value.length>20){
    			alert("用户名超出了范围（1~20）");
    			form1.Username.focus();
    			return false;
    		}
    		if(form1.Password.value==""){
    			alert("密码不能为空！");
    			form1.Password.focus();
    			return false;
    		}
    		if(form1.Password.value.length<1||form1.Password.value.length>10){
    			alert("密码超出了范围（1~10）");
    			form1.Password.focus();
    			return false;
    		}
    	}
    	</script>
	</head>
	<body bgcolor="white">
		<center>
			<h2>用户登录</h2>
			<c:if test="${param.error == 1}">
				<p><font color = red>用户名或者密码错误</font></p>
			</c:if>
			<c:if test="${param.error == 2}">
				<p><font color = red>对不起，您还没有登陆吧</font></p>
			</c:if>
			<br>
			<hr>
			<form name = "form1" method = "post"  onsubmit = "return checkform()" action="login.do">
			<font size=2 color="white">	
			<table>
				<tr>
					<td>用户名</td>
					<td>
						<input type = "text" name= "Username"/>
					</td>
				</tr>
				<tr>
					<td>密&nbsp;&nbsp;码</td>
					<td>
						<input type= "password" name = "Password"/>
					</td>
				</tr>
				<tr>
					<td width = "120" align = "center">&nbsp;</td>
					<td width = "250" valign = "top">
						<input type = "submit" value = "登录" name = "submit">&nbsp;&nbsp;&nbsp;&nbsp;
						<input type = "reset" value = "取消" name = "reset">
					</td>
				</tr>
			</table>
		</form>
		<tr>
			<td colspan = "2" align = "center">
				<p>&nbsp;</p>
				<p><font color = blue>如果您还不是本站会员用户，请点击<a href="userRedirect.do?action=register">这里</a>注册</font></p>
			</td>
		</tr>
	</body>
</html>
						